package com.youlu.campus.entity;

import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * 商户分账利润利润信息
 */
@Getter
@Setter
public class MerchantSharingProfitInfo {

    /**
     * 1 默认 商户 2 个体
     */
    private Integer sharingProfitType  =1;
    /**
     * 是否开启分账 true 开分账
     */
    private Boolean sharingProfit = Boolean.FALSE;

    /**
     * 分账商户号ID 如果是企业商户号，个人是openId
     */
    private String sharingProfitAccount;


    /**
     * 电子证书分账比例
     */
    private Double digitalCaSharingProfitRatio = 0D;

    /**
     * 纸质证书分账比例
     */
    private Double paperCaSharingProfitRatio = 0D;


    /**
     * 视频订单分账比例
     */
    private Double videoOrderSharingProfitRatio = 0D;

    /**
     * 初赛分账比例
     */
    private Double chuSaiSharingProfitRatio = 0D;

    /**
     * 复赛分账比例
     */
    private Double fuSaiSharingProfitRatio = 0D;

    /**
     * 决赛分账比例
     */
    private Double jueSaiSharingProfitRatio = 0D;
    /**
     * 多个商户分账
     */
    private List<MerchantSharingProfitInfo> merchantSharingProfits = new ArrayList<>();


    public Boolean checkMaxSharingProfitRatio(Double maxSharingProfitRatio){
       if(digitalCaSharingProfitRatio.compareTo(maxSharingProfitRatio)==1){
           return Boolean.TRUE;
       }
        if(paperCaSharingProfitRatio.compareTo(maxSharingProfitRatio)==1){
            return Boolean.TRUE;
        }

        if(videoOrderSharingProfitRatio.compareTo(maxSharingProfitRatio)==1){
            return Boolean.TRUE;
        }
        return Boolean.FALSE;
    }


}
